//
//  OneViewController.m
//  fp
//
//  Created by xingshuai on 2020/10/9.
//

#import "OneViewController.h"

#import "ViewController.h"
#import "TwoViewController.h"

@interface OneViewController ()

@end

@implementation OneViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    ViewController *masterViewController = [[ViewController alloc]init];
    UINavigationController *masterNavigationController = [[UINavigationController alloc] initWithRootViewController:masterViewController];
    
    TwoViewController *detailViewController = [[TwoViewController alloc]init];
    UINavigationController *detailNavigationController = [[UINavigationController alloc] initWithRootViewController:detailViewController];
    
    self.splitViewController = [[UISplitViewController alloc] init];
    //配置分屏视图界面外观
    self.splitViewController.preferredDisplayMode = UISplitViewControllerDisplayModeOneBesideSecondary;
    // 左右屏比例
    self.splitViewController.preferredPrimaryColumnWidthFraction = 0.3;
    // 手势识别器，让用户使用划动动作更改显示模式
    //self.splitViewController.presentsWithGesture = YES;
    self.splitViewController.viewControllers = @[masterNavigationController, detailNavigationController];
    [self.view addSubview:self.splitViewController.view];
        
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
